﻿<Window x:Class="Ellanet.Windows.TestWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:converters="clr-namespace:Ellanet.Converters"
        mc:Ignorable="d"
        Title="Test" Height="300" Width="300" WindowStartupLocation="CenterScreen" WindowStyle="None" ResizeMode="NoResize" WindowState="Maximized" Topmost="True" ShowInTaskbar="False" Background="Transparent" AllowsTransparency="True">
    <Window.Resources>
        <converters:IntToImageSourceListConverter x:Key="IntToImageSourceListConverter"/>
        <converters:NullToBoolConverter x:Key="NullToBoolConverter"/>
    </Window.Resources>
    <Grid>
        <Grid.Resources>
            <Style TargetType="Image" x:Key="StandardImageStyle">
                <Setter Property="Stretch" Value="Uniform"/>
                <Setter Property="Height" Value="300"/>
                <Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding NotifyOnTargetUpdated=True, Converter={StaticResource NullToBoolConverter}}" Value="False">
                        <DataTrigger.EnterActions>
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:1.5"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </DataTrigger.EnterActions>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="300"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <ItemsControl Grid.Column ="0" ItemsSource="{Binding Path=Sum.Multiplicand, NotifyOnTargetUpdated=True, Converter={StaticResource IntToImageSourceListConverter}}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Image Source="{Binding}" Style="{StaticResource StandardImageStyle}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
        <Image Grid.Column="1" Source="/Resources/X_Purple.png" Style="{StaticResource StandardImageStyle}" Width="200"/>
        <ItemsControl Grid.Column ="2" ItemsSource="{Binding Path=Sum.Multiplier, NotifyOnTargetUpdated=True, Converter={StaticResource IntToImageSourceListConverter}}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Image Source="{Binding}" Style="{StaticResource StandardImageStyle}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
        <Button Grid.Column="0" IsCancel="True" Opacity="0.0" Width="1" Height="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="CloseButton_OnClick"/>
    </Grid>
</Window>
